<layout name="layout" />
<?php
if (ACTION_NAME == 'edit') {
    $action_url = U(MODULE_NAME . "/update");
} else {
    $action_url = U(MODULE_NAME . "/insert");
}
?>
<form action="{$action_url}" name="art_add" method="post" enctype="multipart/form-data">
    <div class="table_list">
        <table width="100%" cellspacing="0" cellpadding="0" class="table_form">
            <input type="hidden" value="{$vo['cai_id']}" name="id">
            <tbody>
                <tr>
                    <td>菜品名称:</td>
                    <td><input type="text" name="cai_name" maxlength="30" value="{$vo.cai_name}" class="input" /></td>
                </tr>
                <tr>
                    <td>菜品分类:</td>
                    <td> <select name="cai_type_id">
                            <?php
                            $where_var  = "type_shop_id = '" . session("shop_id") . "'";
                            ?>
                            <getData model="CaiType" field="*" name="cai_type" id="row" limit="5" where_var="$where_var" order="sort_order DESC">
                                <option <if condition="$vo['cai_type_id'] == $row['type_id']">selected="selected"</if> value="{$row.type_id}">{$row.type_name}</option>
                            </getData>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>菜品图片:</td>
                    <td>
            <if condition ="!empty($vo['cai_thumb'])">
                <a href="{$vo['cai_thumb']}" target="_blank"><img width="100" alt="" src="{$vo['cai_thumb']}"></a>
                <br />
            </if>
            <input type="file" name="cai_thumb" maxlength="30" value="" class="input" /></td>
            </tr>
            <tr>
                <td>口味:</td>
                <td><input type="text" name="cai_kouwei" maxlength="30" value="{$vo.cai_kouwei}" class="input" /><label class="lab"></label></td>
            </tr>
            <tr>
                <td>描述:</td>
                <td><input type="text" name="cai_desc" maxlength="30" value="{$vo.cai_desc}" class="input" /><label class="lab"></label></td>
            </tr>
            <tr>
                <td>价格:</td>
                <td><input type="text" name="cai_price" maxlength="30" value="{$vo.cai_price|format_price}" class="input" /><label class="lab">元</label></td>
            </tr>
            <tr>
                <td>库存:</td>
                <td><input type="text" name="cai_num" maxlength="30" value="{$vo.cai_num}" class="input" /><label class="lab"></label></td>
            </tr>
            <tr>
                <td>是否显示:</td>
                <td>
                    <select name="status">
                        <option <if condition="$vo['status'] == 0">selected="selected"</if> value="0">不显示</option>
                        <option <if condition="$vo['status'] == 1">selected="selected"</if> value="1">显示</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td></td>
                <td valign="middle"><input type="submit" name="edit_btn" class="btn" value="提 交" /></td>
            </tr>
            </tbody>
        </table>
    </div>
</form>